home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / CRL.CMD < prev    next >
Encoding:
Text File  |  1996-02-16  |  4.7 KB  |  231 lines

  1. #    CRL Network PPP script for Trumpet Winsock 2.0B
  2.   
  3.  #trace on
  4.  #
  5.  # set up some strings for dialling up
  6.  #
  7.  if ![load $number]
  8.    if [query $number "Enter your dial up phone number"]
  9.      save $number
  10.    end  
  11.  end
  12.  if ![load $username]
  13.    if [username "Enter your login username"]
  14.      save $username
  15.    end
  16.  end
  17.  if ![load $password]
  18.    if [password "Enter your login password"]
  19.      save $password
  20.    end 
  21.  end   
  22.  $modemsetup = "&C1\N3s95=44%C1\A3\Q3"
  23.  $prompt = "%"
  24.  $userprompt = "login:"
  25.  $passprompt = "assword:"
  26.  $slipcmd = "slip"
  27.  $addrtarg = "Your address is"
  28.  $pppcmd = "ppp"
  29.  
  30.  %attempts = 20
  31.  #
  32.  #
  33.  #----------------------------------------------------------
  34.  #
  35.  # initialize modem
  36.  #
  37.  output "atz"\13
  38.  if ! [input 10 OK\n]
  39.    display "Modem is not responding"\n
  40.    abort
  41.  end
  42.  #
  43.  # setup our modem commands
  44.  #
  45.  output at$modemsetup\13
  46.  input 10 OK\n
  47.  #
  48.  # send phone number
  49.  #
  50.  %n = 0
  51.  repeat
  52.    if %n = %attempts
  53.      display "Too many dial attempts"\n
  54.      abort
  55.    end
  56.    output "atdt"$number\13
  57.    %ok = [input 60 CONNECT]   
  58.    %n = %n + 1  
  59.  until %ok
  60.  input 10 \n   
  61.  #
  62.  #  wait till it's safe to send because some modem's hang up
  63.  #  if you transmit during the connection phase
  64.  #
  65.  wait 30 dcd
  66.  #
  67.  # now prod the terminal server
  68.  #
  69.  output \13
  70.  #
  71.  #  wait for the username prompt
  72.  #
  73.  input 30 $userprompt
  74.  output $username\13
  75.  #
  76.  # and the password
  77.  #
  78.  input 30 $passprompt
  79.  output $password\13
  80.  #
  81.  # we are now logged in
  82.  #
  83.  online
  84.  
  85.  
  86. #  Trumpet Winsock 2.1 Login.cmd
  87. #
  88. #  Copyright (C) 1994,1995 Peter R. Tattam & 
  89. #  Trumpet Software International Pty Ltd (TSI)
  90. #  All rights reserved.
  91. #
  92. #  Unless TSI has given prior written consent to such use, 
  93. #  no permission is granted to distribute or otherwise make available 
  94. #  to the public modified versions of this script for commercial purposes.  
  95. #  Any permitted distribution of modified versions of the script must
  96. #  retain the copyright notice at the start of this file and must clearly 
  97. #  identify those parts of the file which have been modified.
  98. #
  99. #trace on
  100. #
  101. # set up some strings for dialling up
  102. #
  103. if ![load $number]
  104.   if [query $number "Enter your dial up phone number"]
  105.     save $number
  106.   end
  107. end
  108. if ![load $username]
  109.   if [username "Enter your login username"]
  110.     save $username
  111.   end
  112. end
  113. if ![load $password]
  114.   if [password "Enter your login password"]
  115.     save $password
  116.   end
  117. end
  118. $modemsetup = ""
  119. $prompt = "%"
  120. $userprompt = "login:"
  121. $passprompt = "assword:"
  122. $slipcmd = "slip"
  123. $addrtarg = "our address is"
  124. $pppcmd = "ppp"
  125. $pppready = "PPP."
  126. %attempts = 10
  127.  
  128. ###############################################
  129. # timeouts for various sections of the script #
  130. ###############################################
  131. #
  132. # timeout for busy tone... adjust this until the BUSY string is detected.
  133. #
  134. %busytimeout = 10
  135. #
  136. # time between successive busy attempts.
  137. #
  138. %busywait = 30
  139. #
  140. # time to wait for a CONNECT string to be received
  141. #
  142. %connecttimeout = 60
  143. #
  144. # time to wait until DCD is detected
  145. #
  146. %onlinetimeout = 60
  147. #
  148. # time to wait for username & password prompts
  149. #
  150. %logintimeout = 60
  151. #
  152. # time to wait for server prompt to appear
  153. #
  154. %prompttimeout = 30
  155. #
  156. # time to wait for a SLIP address to be parsed
  157. #
  158. %addresstimeout = 30
  159. #
  160. #
  161. #
  162. #
  163. #----------------------------------------------------------
  164. #
  165. # initialize modem
  166. #
  167. status "Initializing modem..."
  168. output "atz"\13
  169. if ! [input 5 OK\n]
  170.   message "Modem is not responding"
  171.   abort
  172. end
  173. #
  174. # setup our modem commands
  175. #
  176. output "at"$modemsetup\13
  177. if ! [input 10 OK\n]
  178.   message "Modem is not responding"
  179.   abort
  180. end
  181. #
  182. # send phone number
  183. #
  184. %n = 0
  185. repeat
  186.   %n = %n + 1
  187.   if %n > %attempts
  188.     message "Too many dial attempts"
  189.     abort
  190.   end
  191.   status Dialling $number...(attempt %n)
  192.   output "atdt"$number\13
  193.   %busy = [input %busytimeout BUSY]
  194.   if %busy
  195.     status "The line is busy...pausing for a while"
  196.     sleep %busywait
  197.     %ok = 0
  198.   else
  199.     %ok = [input %connecttimeout CONNECT]
  200.   end
  201. until %ok
  202. input 10 \n
  203. #
  204. #  wait till it's safe to send because some modem's hang up
  205. #  if you transmit during the connection phase
  206. #
  207. wait %onlinetimeout dcd
  208. status Connected.  Now logging in as $username...
  209. #
  210. # now prod the terminal server
  211. #
  212. output \13
  213. #
  214. #  wait for the username prompt
  215. #
  216. input %logintimeout $userprompt
  217. output $username\13
  218. #
  219. # and the password
  220. #
  221. input %logintimeout $passprompt
  222. output $password\13
  223. #
  224. # we are now logged in
  225. #
  226. status "Logged in. Now switching to Internet..."
  227.   #
  228.   display \n\n"PPP mode selected.  Will try to negotiate IP address."\n
  229.   status "PPP mode selected.  Will try to negotiate IP address."
  230.   online
  231. # done